//
//  AXMyButtonSelectCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/8.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXMyButtonSelectCell.h"

@implementation AXMyButtonSelectCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setArray:(NSArray *)array {

    CGFloat y = 10;
    for (NSInteger i = 0; i < array.count; i++) {
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(10 * (i % 4 + 1) + (SCREEN_WIDTH - 50) / 4 * (i % 4), y, (SCREEN_WIDTH - 50) / 4, 25);
        y = (25 + 10) * ((i + 1) / 4) + 10;
        [btn setTitle:array[i] forState:UIControlStateNormal];
        btn.backgroundColor = COLOR_GREEN;
        btn.layer.cornerRadius = 3;
        btn.layer.masksToBounds = YES;
        [self.contentView addSubview:btn];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
